package com.njwb.day15.zqzb.ios.io7;

import com.njwb.day15.zqzb.ios.pojo.Student;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.util.Arrays;

public class ObjectInputStreamDemo {
    public static void main(String[] args) {
        ObjectInputStream ois = null ;
        try {
            ois = new ObjectInputStream(new FileInputStream(new File("src/oos.txt")));
            Student[] students  = (Student[]) ois.readObject();
            System.out.println(Arrays.toString(students));

        } catch (IOException e) {
            e.printStackTrace();
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }


    }
}
